package com.situ.day5;

public class Rectangle extends Object{
    private int width;
    private int height;

    public Rectangle() {
        /*width = 1;
        height = 1;*/
        this(1);//new Rectangle(1)
    }

    public Rectangle(int width) {
        this.width = width;
        this.height = width;
    }

    public Rectangle(int width, int height) {
        this.width = width;
        this.height = height;
    }

    public int zhouChang() {
        return (width + height) * 2;
    }

    public int mianJi() {
        return width * height;
    }
}
